import java.io.*;
import java.net.ConnectException;
import java.net.Socket;
import java.util.logging.Logger;

import com.acme.bankapp.domain.*;
public class BankClient {
	private static final Logger logger = Logger.getLogger(BankClient.class.getName());
	public static void main(String[] args) {
       		try {
                Thread.sleep(800);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            new Thread() {
            	public void run() {
            		try {
            				String stringOutAdd;
            				Socket s = new Socket("localhost", 90);
            				PrintWriter out = new PrintWriter(new OutputStreamWriter((s.getOutputStream())), true);
            				for (int i = 0; i < 200; i++) {
            				stringOutAdd = "add;accounttype=s;balance="+i+";overdraft="+(i+1)+";firstname=B"+i+";lastname=B"+i+";gender=f;";
            				out.println(stringOutAdd);
            			}
                        s.close();
            		} catch(Exception e) {
            			logger.warning("Error; socket2");
            		}
                }
            }.start();
	   }
}